<script setup lang="ts">
import { useRouter } from "vue-router";

// vue3自带方法
const router = useRouter();

// 跳转充值页面
const goTopupView = (value:string) =>{
  router.push({
    name:'topup',
    params:{
      value
    }
  })
}

</script>

<template>
  <div class="voucher_center_view">
    <nav>
      <div @click="router.go(-1)" class="app"></div>
      <h1>充值中心</h1>
      <div class="sourch">
        <p @click="router.push('/bookshelfv')">书架</p>
      </div>
    </nav>
    <!-- 充值方式 -->
    <p class="p">选择充值方式</p>
    <ul class="pre-paid">
      <li @click="goTopupView('微信')">
        <van-image width="30" height="30" src="/img/home/wx.png" />
        <span>微信充值</span>
        <i></i>
      </li>
      <li @click="goTopupView('支付宝')">
        <van-image width="30" height="30" src="/img/home/zfb.png" />
        <span>支付宝充值</span>
        <i></i>
      </li>
      <li @click="goTopupView('话费')">
        <van-image width="30" height="30" src="/img/home/hf.png" />
        <span>话费充值</span>
        <i></i>
      </li>
      <li @click="goTopupView('银行卡')">
        <van-image width="30" height="30" src="/img/home/yhk.png" />
        <span>银行卡充值</span>
        <i></i>
      </li>
    </ul>
    <br /><br />

    <footer>
      <p>©2022天浪小说</p>
      <!-- <p>京ICP备 11009265号-5</p> -->
    </footer>
  </div>
</template>

<style lang="scss" scoped>
nav {
  display: flex;
  justify-content: space-between;
  background-color: #ffffff;
  border-bottom: 1px solid #cbcbcb;
  .app {
    width: 36px;
    height: 36px;
    background: url("/public/img/personalCenter/left.png") no-repeat 12px 0px;
    background-size: 18px 18px;
    margin-top: 13px;
    padding-left: 11px;
    padding-right: 44px;
  }
  h1 {
    font-size: 18px;
    color: #333333;
    padding-top: 12px;
    padding-bottom: 10px;
    font-weight: normal;
  }
  .sourch {
    display: flex;
    width: 60px;
    padding-right: 20px;
    justify-content: flex-end;
    align-items: center;
    p {
      font-size: 14px;
      color: #333;
    }
  }
}
.p {
  padding: 0 20px;
  font-size: 14px;
  color: #888;
  height: 33px;
  line-height: 33px;
}
.pre-paid {
  padding-left: 20px;
  background-color: #fff;
  li {
    padding: 10px 0;
    padding-right: 20px;
    height: 30px;
    line-height: 30px;
    display: flex;
    align-items: center;
    position: relative;
    border-bottom: 1px solid #e4e4e4;
    span {
      display: inline-block;
      margin-left: 20px;
      font-size: 14px;
      color: #333;
    }
    i {
      position: absolute;
      display: inline-block;
      right: 20px;
      width: 5px;
      height: 10px;
      background: url("/public/img/home/right.png") right center no-repeat;
      background-size: 5px 10px;
    }
  }
}
footer {
  p {
    text-align: center;
    font-size: 12px;
    color: #999999;
    margin-bottom: 10px;
  }
}
</style>